# def add(x, y):
#     """
#     add函数的作用时把两个参数相加 # DocString
#     """
#     print(x + y)
#
#
# a = 10
# b = 20
# add(a, b)
# help(add)

# python的注释

# （1） #号
# （2） “”“”“”
"""
这是一段注释
"""

# 这是一段注释
# ctrl + /

# a = 10
# print(a)

# 不可变量---int float str bool tuple
# 可变量---list dict set
# a = 10
# b = 3.14
# c = "abc"
# d = True
# e = list(range(11))
# f = tuple(range(11))
# g = dict()
# print(type(a))
# print(type(b))
# print(type(c))
# print(type(d))
# print(type(e))
# print(type(f))
# print(type(g))
#
# # 命名形式
# # make_name蛇形
# # makeName驼峰
#
# a = "这是一串字符串"
# print(f"this is a {a}") # f-string

# input函数
# num = int(input("请输入数字：")) # input函数的返回值是str类型的
# print(num)
# + - * / % //
# a = 10
# b = 20
# print(a + b)
# print(a - b)
# print(a * b)
# print(a / b)
# print(a % b)
# print(a // b)


# 数据的强行转换
# a = 10
# a = str(a)
# print(type(a))
# a = "10"
# a = int(a)
# print(type(a))
# a = 10
# a = float(a)
# print(type(a))

# a = 10
# print("a = %d"% a)
# a = 3.14
# print("a = %.5f" % a)
# a = 10
# print("a = %04d" % a)

# a = 3.16
# print("a = %.1f" % a)

# b = 2
# print("b = %5d" % b)
#
# num = input("请输入一个数字：")
# print(type(num))

# print(chr(97))  # ASCII转字符
# print(ord("a"))   # 给字符转成ASCII码
# ord and chr

# def 函数名（）：
#     代码

# DocString
# def add(a, b):
#     """
#     这是一个相加函数
#     """
#     return a + b
#
#
# # ret = add(10, 20)
# # print(ret)
# help(add)

# def add(a, b):
#     return a + b
#
#
# print("begining")
# ret = add(10,20)
# print(ret)


# import random
# ret = random.randint(1,3)
# print(ret)
# 随机数
# import random
# ret = random.randint(0,1)
# print(ret)
#
# for i in range(11):
#     print(i)
#     if i == 6:
#         break
# else:
#     print("over")

# for i in xxx:
# else:
# 只有当循环全部结束之后才会执行else里面的语句，中断则不执行
#
# num = int(input("请输入一个数字："))
# if num < 0:
#     print("aaa")
# elif num == 0:
#     print("bbb")
# elif num <= 10:
#     print("ccc")
# else:
#     print("ddd")
# num = int(input("请输入数字："))
# 5 if num > 0 else 3
# if num == 3:
#     print("hahaha")
# else:
#     print("not hahaha")

# break and continue
# for i in range(11):
#     print(i)
# a = 10
# while a >= 0:
#     print(a)
#     a -= 1

# def add(a, b):
#     print(a + b)
#     return
#
# ret = add(1, 2)
# print(ret)
# for i in range(1, 10):
#     for k in range(1, i + 1):
#         print(f"{k}*{i} = {k * i}  ",end="")
#     print()